package com.example.hello.hello.factory;

import android.support.v4.app.Fragment;

import com.example.hello.hello.fragment.BbsFragment;
import com.example.hello.hello.fragment.MainFragment;
import com.example.hello.hello.fragment.MapFragment;
import com.example.hello.hello.fragment.ServerFragment;

/**
 * Created by Administrator on 2015/12/30.
 */
public class FragmentFactory {

    public static Fragment getInstanceByIndex(int index){
        Fragment fragment = null;
        switch (index){
            case 1:
                fragment = new MainFragment();
                break;
            case 2:
                fragment = new ServerFragment();
                break;
            case 3:
                fragment = new BbsFragment();
                break;
            case 4:
                fragment = new MapFragment();
                break;
        }
        return fragment;
    }

}
